package com.xbongbong.saas.model;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.IModel;
import com.xbongbong.saas.domain.entity.WorkOrderTemplateEntity;
import com.xbongbong.saas.domain.entity.ext.WorkOrderTemplateEntityExt;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 *
 * @author 魏荣杰
 * @date 2019/3/5 13:56
 * @since v1.0
 * @version v1.0
 */
public interface WorkOrderTemplateModel  extends IModel<WorkOrderTemplateEntity>{
    @Override
    Integer insert(WorkOrderTemplateEntity entity) throws XbbException;

    @Override
    Integer update(WorkOrderTemplateEntity entity) throws XbbException;

    @Override
    List<WorkOrderTemplateEntityExt> findEntitys(Map<String, Object> param);

    List<WorkOrderTemplateEntity> findEntity(Map<String, Object> param);

    @Override
    Integer getEntitysCount(Map<String, Object> param);

    Integer save(WorkOrderTemplateEntity workOrderTemplateEntity) throws XbbException;

    WorkOrderTemplateEntity getBykey(Long key, String corpid);

    Integer moveToDefault(Long categoryId, Long defaultId, String corpid);

    Integer deleteByKey(Long key, String corpid);

    Map<Long, WorkOrderTemplateEntity> getTemplateMap(Collection<Long> templateIds, String corpid);

    /**
     * 批量插入实体
     * @param list
     * @return 返回数据的列表
     */
    List<WorkOrderTemplateEntity> insertBatch(List<WorkOrderTemplateEntity> list);

    Integer updateBatch(List<WorkOrderTemplateEntity> entities,String corpid);

    /**
     * 批量删除
     * @param list 主键id集合
     * @param corpid
     * @author xingxing.xiao
     */
    Integer deleteBatch(List<Long> list, String corpid);
}
